#ifndef THREADBASE
#define THREADBASE

#include <boost/bind.hpp>
#include <boost/thread.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/shared_ptr.hpp>

class threadBase {

protected:

  volatile bool m_stoprequested;

  boost::shared_ptr<boost::thread> m_thread;
  boost::mutex m_mutex;
  boost::condition_variable cond;

protected:

  virtual void run() = 0;

public:

  void start();
  virtual void stop();

  threadBase();
  virtual ~threadBase();
};

#endif